﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="Articles.aspx.vb" Inherits="Testing.Articles" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<fieldset>
    <legend style="width:auto">Best Rating Articles (Minimum Average : 3 out 5</legend>

        <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
            ConnectionString="<%$ ConnectionStrings:DBConnString %>" 
            ProviderName="<%$ ConnectionStrings:DBConnString.ProviderName %>" 
            
        SelectCommand="SELECT AvgAR, A_Name, ID FROM Query_ArticlesAvgRating Where AvgAR >=3">
        </asp:SqlDataSource>
        <br />
        <asp:Repeater ID="Repeater2" runat="server" DataSourceID="SqlDataSource3">
        <ItemTemplate>
           <a href="ArticleDetails.aspx?ID=<%# Eval("ID")%>"><%# Eval("A_Name")%></a><br />
        </ItemTemplate>
        </asp:Repeater>
    </fieldset>
    <asp:Button ID="btn_add_article" runat="server" Text="Add Article" />
    <hr />
    <br />
    <fieldset>
    <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">
    <ItemTemplate>
     <a class="__headerStyle" href="ArticleDetails.aspx?ID=<%# Eval("ID")%>"><%# Eval("A_Name")%></a>
     <p style="text-align:right">posted By <%# Eval("UserName")%></p>
     <p style="text-align:right">on <%# Eval("A_PostDate")%></p>
     <hr />
    </ItemTemplate>
    </asp:Repeater>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DBConnString %>" 
        ProviderName="<%$ ConnectionStrings:DBConnString.ProviderName %>" 
        
        SelectCommand="SELECT [ID], [A_Name], [A_Desc], [A_PostDate], [UserName] FROM [Query_DisplayArticles] ORDER BY [ID] DESC">
    </asp:SqlDataSource>
    </fieldset>
</asp:Content>
